package cn.ekuma.epos.crm.model;

import com.openbravo.bean.crm.CustomerPeople;
import com.openbravo.format.Formats;
import com.openbravo.pos.base.AppLocal;

import cn.ekuma.data.ui.swing.AbstractDTOTableModel;

public class CustomerPeopleTableModel extends AbstractDTOTableModel<CustomerPeople>{

	@Override
	public Object getValueAt(int rowIndex, int columnIndex) {
		CustomerPeople obj=getObj(rowIndex);
		switch(columnIndex){
		     case  0:
			    return obj.getName();
		     case 1:
		    	 return Formats.TIMESTAMP.formatValue(obj.getCreateDate());
		     case 2:
		    	 return obj.getFirstname();
		     case 3:
		    	 return obj.getLastname();
		     case 4:
		    	 return obj.getEmail();
		     case 5:
		    	 return obj.getPhone();
		     case 6:
		    	 return obj.getPhone2();
		     case 7:
		    	 return obj.getFax();
		     case 8:
		    	 return obj.getAddress();
		     case 9:
		    	 return obj.getAddress2();
		     case 10:
		    	 return obj.getPostal();
		     case 11:
		    	 return obj.getCity();
		     case 12:
		    	 return obj.getRegion();
		     case 13:
		    	 return obj.getCountry();
		     case 14:
		    	 return obj.getDepartment();
		     case 15:
		    	 return obj.getPosition();
		     case 16:
		    	 return obj.getMemo();
		}
		return null;
	}

	@Override
	public String[] getColumnNames() {
		return new String[]{
				AppLocal.getIntString("label.name"),
				AppLocal.getIntString("label.createTime"),
				AppLocal.getIntString("label.firstname"),
				AppLocal.getIntString("label.lastname"),
				AppLocal.getIntString("label.email"),
				AppLocal.getIntString("label.phone"),
				AppLocal.getIntString("label.phone2"),
				
				AppLocal.getIntString("label.fax"),
				AppLocal.getIntString("label.address"),
				AppLocal.getIntString("label.address2"),
				AppLocal.getIntString("label.postal"),
				AppLocal.getIntString("label.city"),
				
				AppLocal.getIntString("label.region"),
				AppLocal.getIntString("label.country"),
				AppLocal.getIntString("label.department"),
				AppLocal.getIntString("label.position"),
				AppLocal.getIntString("label.notes")
		};
	}

}
